import numpy as np


# filepath='dataset\single_flow_single_link\\network_0'
# data=np.loadtxt(filepath+'\\node_data.txt', delimiter=',', dtype=np.float32)
# print(data)

import numpy as np
data=[]
for i in range(512,1024+512+1):
    data.append([[i, 3],
     [0, 0],
     [0, 0],
     [0, 0]])
print(data)
data=np.array(data,dtype=np.float32)
print(data)

# b = np.array([[[1100.,    3.],
#                 [   0.,    0.],
#                 [   0.,    0.],
#                 [   0.,    0.]],
#               [[1000.,    3.],
#                 [   0.,    0.],
#                 [   0.,    0.],
#                 [   0.,    0.]]],dtype=np.float32)
with open('b.txt', 'w') as outfile:
    # for slice_2d in b:
    for slice_2d in data:
        np.savetxt(outfile, slice_2d,newline='\n', fmt = '%f', delimiter = ',')
        outfile.write('\n')
c = np.loadtxt('b.txt', delimiter = ',').reshape((-1, 4, 2))
print(c)

